/*
 * Copyright 2012 Focus Technology, Co., Ltd. All rights reserved.
 */
package com.coderonrails.cdistr.master.session;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * SlaveInfo.java
 * 
 * @author chenjianguo
 */
public class SlaveInfo {
    public String SlaveCode;
    public String SlaveName;
    public String SlaveHost;
    public long loginTime;
    public long lastChectTime;
    public int status;

    public String getSlaveCode() {
        return SlaveCode;
    }

    public void setSlaveCode(String slaveCode) {
        SlaveCode = slaveCode;
    }

    public String getSlaveName() {
        return SlaveName;
    }

    public void setSlaveName(String slaveName) {
        SlaveName = slaveName;
    }

    public String getSlaveHost() {
        return SlaveHost;
    }

    public void setSlaveHost(String slaveHost) {
        SlaveHost = slaveHost;
    }

    public long getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(long loginTime) {
        this.loginTime = loginTime;
    }

    public long getLastChectTime() {
        return lastChectTime;
    }

    public void setLastChectTime(long lastChectTime) {
        this.lastChectTime = lastChectTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return SlaveCode + "\t" + SlaveName + "\t" + status + "\t" + sdf.format(new Date(loginTime)) + "\t"
                + sdf.format(new Date(lastChectTime));
    }

}
